﻿
@{
    ViewData["Title"] = "发起流程";
    Layout = "~/Views/Shared/_LayoutMobile.cshtml";
}
<div class="weui-loadmore">
    <i class="weui-loading"></i>
    <span class="weui-loadmore__tips">正在加载</span>
</div>
<div id="flowsdiv"></div>
<script type="text/javascript">
    $(function () {
        loadFlow();
    });
    function loadFlow() {
        $(".weui-loadmore").show();
        $.ajax({
            url: "../Api/Mobile/QueryStatrFlow", async: true, type:"post", data: { "UserId": "" }, dataType: "json", success: function (json) {
                html = '';
                for (i = 0; i < json.length; i++) {
                    html += '<div class="startflow_type">' + json[i].type + '</div>';
                    html += '<div class="weui-grids" style="margin-top:5px;">';
                    for (j = 0; j < json[i].flows.length; j++) {
                        flow = json[i].flows[j];
                        html += '<a href="/RoadFlowCore/FlowRun/Index?flowid=' + flow.id + '&ismobile=1" class="weui-grid js_grid">';
                        html += '<div class="weui-grid__icon">';
                        if (flow.ico.indexOf("fa") == 0) {
                            html += '<i class="fa ' + flow.ico + '" style="color:' + (flow.bgcolor || '#fff') + ';"></i>';
                        }
                        else {
                            html += '<img src="' + flow.ico + '" alt="">';
                        }
                        html += '</div>';
                        html += '<p class="weui-grid__label">';
                        html += flow.name;
                        html += '</p>';
                    }
                    html += '</a></div>';
                }
                $("#flowsdiv").html(html);
                $(".weui-loadmore").hide();
            }
        });
    }
</script>

